package org.lan.interview.mock;

/**
 * @author <p><a href="mailto:1728209643@qq.com">XiaoSan</a>
 * @date 2019/11/26 5:00 PM
 */
public class Mock_004 {
    public int findMaxConsecutiveOnes(int[] nums) {
        int c = 0;
        int tc = 0;
        for (int num : nums) {
            if (num == 1) {
                tc += 1;
            } else {
                c = Math.max(c, tc);
                tc = 0;
            }
        }
        return Math.max(c, tc);
    }
}
